<?xml version="1.0" encoding="utf-8"?>
<openerp>
	<data>
		<record id="view_delivery_report" model="ir.ui.view">
			<field name="name">view.delivery.report</field>
			<field name="model">delivery.report</field>
			<field name="type">form</field>
			<field name="arch" type="xml">
				<form string="Delivery Report">
					<group>
						<notebook tabpos="up" colspan="4">
							<page string="Date" name="filters_date">
		                        <group string="">
		                        	<field name="date_filter_selection" on_change="onchange_date_selection(date_filter_selection)"/> 
									<field name="date_from"
										attrs="{'invisible': [('date_filter_selection','!=','date')]}"
										/>
									<field name="date_to"
										attrs="{'invisible': [('date_filter_selection','!=','date')]}"
										/>
		                        </group>
							</page>
							<page string="SO No." name="filters_so_no">
		                        <group string="">
		                        	<field name="so_filter_selection" on_change="onchange_filter_so_selection(so_filter_selection)"/> 
		                        	<field name="so_no_def_from" 
			                        	attrs="{'invisible': [('so_filter_selection','!=','def')], 'required': [('so_filter_selection','=','def')]}"
										/>
									<field name="so_no_def_to" 
										attrs="{'invisible': [('so_filter_selection','!=','def')], 'required': [('so_filter_selection','=','def')]}"
										/>
									<field name="so_no_input_from"
										attrs="{'invisible': [('so_filter_selection','!=','input')], 'required': [('so_filter_selection','=','input')]}"
										/>
									<field name="so_no_input_to"
										attrs="{'invisible': [('so_filter_selection','!=','input')], 'required': [('so_filter_selection','=','input')]}"
										/> 
		                        </group>
		                        	<field name="so_ids" domain="[('state','!=','cancel')]"
										attrs="{'invisible': [('so_filter_selection','!=','selection')], 'required': [('so_filter_selection','=','selection')]}" nolabel="1"
										/>	
							</page>
							<page string="DO No." name="filters_do_no">
		                        <group string="">
		                        	<field name="do_filter_selection" on_change="onchange_filter_do_selection(do_filter_selection)"/> 
		                        	<field name="do_no_def_from" domain="[('state','=','done'),('picking_type_id','=',2)]"
			                        	attrs="{'invisible': [('do_filter_selection','!=','def')], 'required': [('do_filter_selection','=','def')]}"
										/>
									<field name="do_no_def_to" domain="[('state','=','done'),('picking_type_id','=',2)]"
										attrs="{'invisible': [('do_filter_selection','!=','def')], 'required': [('do_filter_selection','=','def')]}"
										/>
									<field name="do_no_input_from"
										attrs="{'invisible': [('do_filter_selection','!=','input')], 'required': [('do_filter_selection','=','input')]}"
										/>
									<field name="do_no_input_to"
										attrs="{'invisible': [('do_filter_selection','!=','input')], 'required': [('do_filter_selection','=','input')]}"
										/> 
		                        </group>
		                        	<field name="do_ids" domain="[('state','=','done'),('picking_type_id','=',2)]"
										attrs="{'invisible': [('do_filter_selection','!=','selection')], 'required': [('do_filter_selection','=','selection')]}" nolabel="1"
										/> 
							</page> 
							<page string="Invoice No." name="filters_inv_no">
		                        <group string="">
		                        	  
		                        </group>
							</page>  
							<page string="Customer" name="filters_cust_name">
		                        <group string="">
		                        	<field name="cust_filter_selection" on_change="onchange_filter_cust_selection(cust_filter_selection)"/> 
		                        	<field name="cust_name_def_from" domain="[('customer','=',True)]"
			                        	attrs="{'invisible': [('cust_filter_selection','!=','def')], 'required': [('cust_filter_selection','=','def')]}"
										/>
									<field name="cust_name_def_to" domain="[('customer','=',True)]"
										attrs="{'invisible': [('cust_filter_selection','!=','def')], 'required': [('cust_filter_selection','=','def')]}"
										/>
									<field name="cust_name_input_from"
										attrs="{'invisible': [('cust_filter_selection','!=','input')], 'required': [('cust_filter_selection','=','input')]}"
										/>
									<field name="cust_name_input_to"
										attrs="{'invisible': [('cust_filter_selection','!=','input')], 'required': [('cust_filter_selection','=','input')]}"
										/>  	 
		                        </group>
		                        	<field name="partner_ids" domain="[('customer','=',True)]"
										attrs="{'invisible': [('cust_filter_selection','!=','selection')], 'required': [('cust_filter_selection','=','selection')]}" nolabel="1"
										/>
							</page> 
							<page string="Currency" name="filters_currency">
		                        <group string="">
		                        	<field name="curr_filter_selection" on_change="onchange_filter_curr_selection(curr_filter_selection)"/> 
		                        	<field name="curr_name_def_from" 
			                        	attrs="{'invisible': [('curr_filter_selection','!=','def')], 'required': [('curr_filter_selection','=','def')]}"
										/>
									<field name="curr_name_def_to" 
			                        	attrs="{'invisible': [('curr_filter_selection','!=','def')], 'required': [('curr_filter_selection','=','def')]}"
										/>	 
									<field name="curr_name_input_from"
										attrs="{'invisible': [('curr_filter_selection','!=','input')], 'required': [('curr_filter_selection','=','input')]}"
										/>
									<field name="curr_name_input_to"
										attrs="{'invisible': [('curr_filter_selection','!=','input')], 'required': [('curr_filter_selection','=','input')]}"
										/> 
		                        </group>
		                        	<field name="currency_ids"
										attrs="{'invisible': [('curr_filter_selection','!=','selection')], 'required': [('curr_filter_selection','=','selection')]}" nolabel="1"
										/> 
							</page>
							<page string="Sort By">
								<group>
									<field name="sortby_ids">
				                        <tree string="Sort by" editable="bottom">
				                            <field name="seq" />
				                            <field name="sort_by"/>
				                        </tree>
	                    			</field>
								</group>
						</page>  
						</notebook>
					</group>
				<footer>
                    <button name="create_vat" string="Print as PDF" type="object" default_focus="1" class="oe_highlight"/>
                    or
	                <button name="print_report" string="Print as XLS" type="object" class="oe_highlight" context="{'xls_output':1}"/>
                    or		 
                    <button string="Cancel" class="oe_link" special="cancel"/>
                </footer>
				</form>
			</field>
		</record>

		<record id="action_delivery_report" model="ir.actions.act_window">
			<field name="name">Delivery Report</field>
			<field name="type">ir.actions.act_window</field>
			<field name="res_model">delivery.report</field>
			<field name="view_type">form</field>
			<field name="view_mode">form</field>
			<field name="target">new</field>
			<field name="help">This menu print Delivery Report.</field>
		</record>

		<menuitem name="Delivery Report" parent="menu_receiving"
			action="action_delivery_report" id="menu_delivery_report" sequence="4"/>

	</data>
</openerp>
